<%@ page contentType="text/html; charset=UTF-8"%>
<% response.setHeader("Cache.Control","no-cache"); response.setHeader("Pragma","no-cache"); response.setDateHeader("Expires",0);%>

<jsp:useBean id="action" scope="request"
	class="swd.basic.table_schema_maintain.Action" />
<jsp:useBean id="view" scope="request"
	class="swd.basic.table_schema_maintain.View" />
<jsp:setProperty name="view" property="*" />
<%if (action.action(pageContext).equals("login")){return;} %>
<jsp:useBean id="DataView" scope="request"
	type="com.pub.database.DataView" />
<!-- 以下為DataView 共用設定 -->
<jsp:useBean id="DataViewForm" scope="request"
	type="com.pub.database.DataViewForm" />
<jsp:setProperty name="DataViewForm" property="submitMethod"
	value="POST" />
<jsp:setProperty name="DataViewForm" property="pageRowCount" value="0" />
<jsp:setProperty name="DataViewForm" property="nowPageNum" />
<jsp:setProperty name="DataViewForm" property="dataViewAction" />
<jsp:setProperty name="DataViewForm" property="filterCol" />
<jsp:setProperty name="DataViewForm" property="filterValue" />
<jsp:setProperty name="DataViewForm" property="dvOrderByFields" />
<jsp:setProperty name="DataViewForm" property="dvOrderBySeq" />
<!-- DataView 設定結束 -->

<html>
<head>
<title><%=view.getPrgTitle()%></title>
<LINK HREF="/SWD/workflow.css" REL="STYLESHEET" TYPE="TEXT/CSS">
<script type="text/javascript" language="javascript1.2"
	src="/PUBPAGE/general/commscript.js"></script>
<script type="text/javascript" language="javascript1.2"
	src="/PUBPAGE/general/commhtmlscript.js"></script>
<SCRIPT type="text/javascript" LANGUAGE="javascript1.2"
	SRC="/SWD/general/pub.js"></SCRIPT>
<SCRIPT type="text/javascript" LANGUAGE="javascript1.2"
	SRC="/SWD/general/swd.js"></SCRIPT>
<SCRIPT type="text/javascript" LANGUAGE="javascript1.2"
	src="/SWD/general/table_schema_maintain.js"></script>
</head>
<body bgcolor="#ffffff"
	onload="on_loading();<%=view.getOnloadScript()==null ?"":view.getOnloadScript()%>">
<TABLE BORDER="0" HEIGHT="20" CELLPADDING="0" CELLSPACING="0">
	<TR>
		<TD BACKGROUND="/SWD/pub_images/title_bg.gif">
		<DIV ALIGN="LEFT"><IMG SRC="/SWD/pub_images/title01.gif"
			WIDTH="18" HEIGHT="24" HSPACE="0" alt="" /><IMG
			SRC="/SWD/pub_images/glass.gif" WIDTH="12" HEIGHT="8" alt="" /></DIV>
		</TD>
		<TD ALIGN="LEFT" HEIGHT="20" VALIGN="MIDDLE"
			BACKGROUND="/SWD/pub_images/title_bg.gif" CLASS="TITLE">步驟3、資料表結構維護</TD>
		<TD BACKGROUND="/SWD/pub_images/title_bg.gif">
		<DIV ALIGN="RIGHT"><IMG SRC="/SWD/pub_images/glass.gif"
			WIDTH="12" HEIGHT="8" alt="" /><IMG SRC="/SWD/pub_images/title02.gif"
			WIDTH="18" HEIGHT="24" HSPACE="0" alt="" /></DIV>
		</TD>
	</TR>
</TABLE>
<br />
<form action="<%=request.getRequestURI() %>" method="POST"
	name="table_schema_maintain">
<TABLE BORDER="0" CELLSPACING="1" CELLPADDING="0">
	<TR>

		<TD style="" width="5%" CLASS="td_content"><INPUT TYPE="BUTTON"
			VALUE="<%=view.getBtnAddTitle()%>" CLASS="button b_normal"
			ONCLICK="javascript:fc_add_before_check();" /></TD>
		<!--<TD style="DISPLAY='<%=view.getBtnSaveShow()%>'" width="5%" CLASS="td_content"><INPUT TYPE="BUTTON" VALUE="<%=view.getBtnSaveTitle()%>" CLASS="button b_normal" ONCLICK="javascript:document.all.item('prgAction').value='save';document.forms[0].submit();"/></TD>-->

		<TD style="" width="5%" CLASS="td_content"><INPUT TYPE="BUTTON"
			VALUE="<%=view.getBtnQueryTitle()%>" CLASS="button b_normal"
			ONCLICK="javascript:fc_check_to_query();" /></TD>
		<TD style="" width="5%" CLASS="td_content"><INPUT TYPE="BUTTON"
			VALUE="<%=view.getBtnExitTitle()%>" CLASS="button b_normal"
			ONCLICK="javascript:document.all.item('prgAction').value='exit';document.forms[0].submit();" /></TD>
		<TD width="90%" CLASS="td_content">&nbsp;</TD>
	</TR>
	<TR>
		<TD colspan=5><font color="red"><%=(view.getTipMessage()!=null ?  view.getTipMessage() : "")%></font>
		</TD>
	</TR>
</TABLE>
<TABLE BORDER="0" WIDTH="540px" CELLSPACING="1" CELLPADDING="0">
	<TR>
		<TD nowrap WIDTH="20%" CLASS="td_head"><%=view.getdbf_noTitle()%></TD>
		<TD WIDTH="80%" CLASS="td_content" colspan="3"><INPUT TYPE="TEXT"
			NAME="dbf_no" SIZE="40" MAXLENGTH="40"
			VALUE="<%=(view.getdbf_no()!=null ? view.getdbf_no() : "")%>"
			<%=view.getdbf_no_readonly() ? "readonly" : "onDblClick=\"fc_get_table_name(this);\""%>
			CLASS="<%=(view.getdbf_no_readonly() ? "input_noborder" : "input_window hand")%>" />
		</TD>
	</TR>
</table>
<TABLE BORDER="0" WIDTH="540px" CELLSPACING="1" CELLPADDING="0" style="">
	<TR>
		<TD nowrap WIDTH="20%" CLASS="td_head"><%=view.getseqnoTitle()%></TD>
		<TD WIDTH="30%" CLASS="td_content"><INPUT TYPE="TEXT"
			NAME="seqno" SIZE="4" MAXLENGTH="4"
			VALUE="<%=(view.getseqno()!=null ? view.getseqno() : "")%>"
			<%=view.getseqno_readonly() ? "readonly" : ""%>
			CLASS="<%=(view.getseqno_readonly() ? "input_noborder" : "input")%>" />
		</TD>
		<TD nowrap WIDTH="20%" CLASS="td_head"><%=view.getfld_noTitle()%></TD>
		<TD WIDTH="30%" CLASS="td_content"><INPUT TYPE="TEXT"
			NAME="fld_no" SIZE="35" MAXLENGTH="40"
			VALUE="<%=(view.getfld_no()!=null ? view.getfld_no() : "")%>"
			<%=view.getfld_no_readonly() ? "readonly" : ""%>
			CLASS="<%=(view.getfld_no_readonly() ? "input_noborder" : "input")%>" />
		</TD>
	</TR>
	<TR>
		<TD nowrap WIDTH="20%" CLASS="td_head"><%=view.getfld_nameTitle()%></TD>
		<TD WIDTH="80%" CLASS="td_content" colspan="3"><INPUT TYPE="TEXT"
			NAME="fld_name" SIZE="60" MAXLENGTH="100"
			VALUE="<%=(view.getfld_name()!=null ? view.getfld_name() : "")%>"
			<%=view.getfld_name_readonly() ? "readonly" : ""%>
			CLASS="<%=(view.getfld_name_readonly() ? "input_noborder" : "input")%>" />
		</TD>
	</TR>
	<TR>
		<TD nowrap WIDTH="20%" CLASS="td_head"><%=view.getfld_kindTitle()%></TD>
		<TD WIDTH="30%" CLASS="td_content"><SELECT NAME="fld_kind"
			SIZE="1"
			onfocus="javascript:if(<%=view.getfld_kind_readonly()%>==1){this.blur();}"
			CLASS="select">
			<OPTION VALUE="C"
				<%if(view.getfld_kind() !=null){out.print((view.getfld_kind().equals("C") ? "selected" : ""));}%>>文字</OPTION>
			<OPTION VALUE="N"
				<%if(view.getfld_kind() !=null){out.print((view.getfld_kind().equals("N") ? "selected" : ""));}%>>數字</OPTION>
			<OPTION VALUE="D"
				<%if(view.getfld_kind() !=null){out.print((view.getfld_kind().equals("D") ? "selected" : ""));}%>>日期</OPTION>
			<OPTION VALUE="L"
				<%if(view.getfld_kind() !=null){out.print((view.getfld_kind().equals("L") ? "selected" : ""));}%>>LONGRAW</OPTION>
		</SELECT></TD>
		<TD nowrap WIDTH="20%" CLASS="td_head"><%=view.getis_keyTitle()%></TD>
		<TD WIDTH="30%" CLASS="td_content"><SELECT NAME="is_key"
			SIZE="1"
			onfocus="javascript:if(<%=view.getis_key_readonly()%>==1){this.blur();}"
			CLASS="select">
			<OPTION VALUE="Y"
				<%if(view.getis_key() !=null){out.print((view.getis_key().equals("Y") ? "selected" : ""));}%>>是</OPTION>
			<OPTION VALUE="N"
				<%if(view.getis_key() !=null){out.print((view.getis_key().equals("N") ? "selected" : ""));}%>>否</OPTION>
		</SELECT></TD>
	</TR>
	<TR>
		<TD nowrap WIDTH="20%" CLASS="td_head"><%=view.getwideTitle()%></TD>
		<TD WIDTH="30%" CLASS="td_content"><INPUT TYPE="TEXT"
			NAME="wide" SIZE="4" MAXLENGTH="4"
			VALUE="<%=(view.getwide()!=null ? view.getwide() : "")%>"
			<%=view.getwide_readonly() ? "readonly" : ""%>
			CLASS="<%=(view.getwide_readonly() ? "input_noborder" : "input")%>" />
		</TD>
		<TD nowrap WIDTH="20%" CLASS="td_head"><%=view.getwide_decTitle()%></TD>
		<TD WIDTH="30%" CLASS="td_content"><INPUT TYPE="TEXT"
			NAME="wide_dec" SIZE="4" MAXLENGTH="4"
			VALUE="<%=(view.getwide_dec()!=null ? view.getwide_dec() : "")%>"
			<%=view.getwide_dec_readonly() ? "readonly" : ""%>
			CLASS="<%=(view.getwide_dec_readonly() ? "input_noborder" : "input")%>" />
		</TD>
</TABLE>
<INPUT TYPE="HIDDEN" NAME="editmail_yn"
	VALUE="<%=(view.geteditmail_yn()!=null ? view.geteditmail_yn() : "")%>" />
<INPUT TYPE="HIDDEN" NAME="prgAction" VALUE="<%=view.getPrgAction()%>" />
<INPUT TYPE="HIDDEN" NAME="prgStatus" VALUE="<%=view.getPrgStatus()%>" />
<INPUT TYPE="HIDDEN" NAME="flowAction" VALUE="<%=view.getFlowAction()%>" />
<INPUT TYPE="HIDDEN" NAME="flowStatus" VALUE="<%=view.getFlowStatus()%>" />
<INPUT TYPE="HIDDEN" NAME="insertcount"
	VALUE="<%=view.getinsertcount()%>" /> <INPUT TYPE="HIDDEN"
	NAME="import_yn" VALUE="" /> <INPUT TYPE="hidden"
	NAME="dataviewtotalcount" VALUE="<%=view.getdataviewtotalcount()%>" />
<br />

<TABLE BORDER="0" WIDTH="540px" CELLSPACING="1" CELLPADDING="0">
	<TR>
		<TD style="" width="5%" CLASS="td_content"><INPUT TYPE="BUTTON"
			VALUE="<%=view.getBtnSaveAllTitle()%>" CLASS="button b_normal"
			ONCLICK="javascript:fc_save_before_check();" /> <input type="button"
			value="<%=view.getBtnReOrderTitle()%>" CLASS="button b_normal"
			ONCLICK="javascript:fc_seqno_reorder();" /> <input type="button"
			value="<%=view.getBtnImportFlowTitle()%>" CLASS="button b_normal"
			onclick="javascript:document.all.item('import_yn').value='Y';fc_add_before_check();">
		<input type="button" value="<%=view.getBtnGenerateSQLTitle()%>"
			CLASS="button b_normal" onclick="javascript:fc_generate_sql();" /></TD>
	</TR>
	<tr>
		<TD style="">
		<div class="ps"><%=view.getNoteTitle()%></div>
		</td>
	</tr>
	<tr>
		<td>
		<%
       DataView.OutputDataView(DataViewForm, pageContext);
      %>
		</td>
	</tr>
	<tr>
		<td style=""><input type="button"
			value="<%=view.getBtnCopySQLToClipboardTitle()%>"
			CLASS="button b_normal"
			onclick="javascript:fc_copy_sql(document.all.item('gSQL'));">
		</td>
	</tr>
	<tr>
		<td style=""><textarea name="gSQL" Cols="150" Rows="10"
			class="textarea">
</textarea></td>
	</tr>
</TABLE>
<INPUT TYPE="HIDDEN" NAME="dataviewtotalcount1"
	VALUE="<%=String.valueOf(DataViewForm.getTotalDataSize())%>" /></form>
</body>
</html>
